package cn.weakup.designpattern.c_structural.decorator;

import cn.weakup.designpattern.c_structural.decorator.usepattern.LoginSsoDecorator;

/**
 * @author lixj
 * @version 1.0.0
 * @date 2022/6/4
 * @desc 模拟登录过程中的校验操作，判断⽤户是否可登录以及是否可访问⽅法
 */
public class TestUsePattern {

    public static void main(String[] args) {
        LoginSsoDecorator ssoDecorator = new LoginSsoDecorator(new SsoInterceptor());
        String request = "success-developer";
        boolean success = ssoDecorator.preHandle(request, "response", "handler");
        System.out.println("登录校验：" + request + (success ? " 放⾏" : " 拦截"));
    }
}
